home *** CD-ROM | disk | FTP | other *** search
- unit Ovr_Obj;
-
- {
- "OBJitized" data (data that has been converted to an OBJ file with the BINOBJ
- utility) normally cannot be used in an overlayed unit. The function OvrObj
- circumvents this restriction, returning a pointer to the actual data, whether
- or not the unit is overlaid. See OVROBJ.DOC for more information.
-
- Written by Ron Schuster. Copyright (c) 1989, Ron Schuster. All rights reserved.
- May be distributed freely, but not for a profit.
-
- Version 1.0, 11/29/89
- --------------------
- Initial release.
- }
-
- interface
-
- function OvrObj (X : Pointer) : Pointer;
- inline ($58/ { pop ax ; Offset part of X }
- $07/ { pop es ; Segment part of X }
- $26/$81/$3e/$00/$00/$cd/$3f/ { cmp es:word ptr [0],3FCD ; Overlaid? }
- $75/$06/ { jne NotOverlayed ; Jump if not }
- $40/ { inc ax ; Skip over op code }
- $89/$c7/ { mov di,ax ; Set up for LES }
- $26/$c4/$05/ { les ax,es:[di] ; Get data address }
- $8c/$c2); { NotOverlayed: mov dx,es ; Return it in DX:AX}
-
- implementation
-
- end.
-